package cn.boodqian.airreport;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ViewFlipper;

/* ViewFlipper bug workaround (Android 2.1/2.2)
 * See http://daniel-codes.blogspot.com/2010/05/viewflipper-receiver-not-registered.html */
public class BugFixedViewFlipper extends ViewFlipper {
    public BugFixedViewFlipper(Context context) {
        super(context);
    }
    public BugFixedViewFlipper(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
    @Override
    protected void onDetachedFromWindow() {
        try {
            super.onDetachedFromWindow();
        }
        catch (IllegalArgumentException e) {
            stopFlipping();
        }
    }
}
